package com.xiehua.task.prop;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Map;

public class XiehuaConfig {

    private static Logger log = LoggerFactory.getLogger(XiehuaConfig.class);

    //修正时间戳
    public static int REVISE_TIME = 5;

    private static Map<String, String> configMap;

    public static final String KEY_SERVER_HOST = "task.server.host";

    public static final String KEY_SERVER_PORT = "task.server.port";

    public static final String KEY_SERVER_TIMEOUT = "task.server.timeout";

    public static final String KEY_CLIENT_INTERVAL = "task.client.interval";

    public static final String KEY_CLIENT_TOPIC = "task.client.topic";

    public static final String KEY_CLIENT_CID = "task.client.cid";

    public static final String KEY_CLIENT_SECRET_KEY = "task.client.secret_key";

    public static final String KEY_CLIENT_DELAY_TASK_EXECUTER = "task.client.delay_task.executer";

    public static final String KEY_CLIENT_FIXED_TASK_PACKAGE = "task.client.fixed_task.package";

    public static final String REDIS_HOST = "redis.host";

    public static final String REDIS_PORT = "redis.port";

    public static final String REDIS_PWD = "redis.pwd";

    public static final String REDIS_DB = "redis.db";

    public static final String SERVER_MONITOR_SWITCH = "server.monitor.switch";

    public static final String SERVER_EMAIL_DO_NOT_DISTURB = "server.monitor.do_not_disturb";

    public static final String SERVER_EMAIL_USERNAME = "server.monitor.email.username";

    public static final String SERVER_EMAIL_PASSWORD = "server.monitor.email.password";

    public static final String SERVER_EMAIL_FROM = "server.monitor.email.from";

    public static final String SERVER_EMAIL_TO = "server.monitor.email.to";

    public static final String SERVER_DINGDING_ROBOT = "server.monitor.dingding.robot";

    public static final String PERSISTENCE_PATH = "persistence.path";


    private XiehuaConfig() {
    }


    public static Map<String, String> getInstance() {
        if (configMap == null) {
            synchronized (XiehuaConfig.class) {
                if (configMap == null) {
                    configMap = new PropsUtil("task").loadPropsToMap();
                }
            }
        }
        return configMap;
    }

}
